﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Epsilon.Typing;

namespace Epsilon.Expr
{
    public class VarExpr : Expression, IPattern
    {
        public string Var { get; private set; }

        public VarExpr(string v, int l, int c) : base(l, c)
        {
            Var = v;
        }

        public override bool Equals(object obj)
        {
            return (obj is VarExpr) && (((VarExpr)obj).Var == this.Var);
        }

        public override int GetHashCode()
        {
            return this.Var.GetHashCode();
        }

        public override string ToString()
        {
            return this.Var;
        }
    }
}
